import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { MongoRepository } from 'typeorm';
import { Photo } from './entities/mongo-typeorm.entity';
import { CreatePhotoDto } from './dto/create.photo.dto';

@Injectable()
export class MongoTypeormService {
  constructor(
    @InjectRepository(Photo)
    private readonly photoRepository: MongoRepository<Photo>,
  ) {}

  async createPhoto(photo: CreatePhotoDto): Promise<CreatePhotoDto> {
    return this.photoRepository.save(photo);
  }
}
